package org.celery.modules.goods.service.impl;

import org.celery.modules.goods.entity.Goods;
import org.celery.modules.goods.vo.GoodsVO;
import org.celery.modules.goods.mapper.GoodsMapper;
import org.celery.modules.goods.service.IGoodsService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;

/**
 * 商品表 服务实现类
 *
 * @author Celery
 * @since 2021-10-26
 */
@Service
public class GoodsServiceImpl extends BaseServiceImpl<GoodsMapper, Goods> implements IGoodsService {

	@Override
	public IPage<GoodsVO> selectGoodsPage(IPage<GoodsVO> page, GoodsVO goods) {
		return page.setRecords(baseMapper.selectGoodsPage(page, goods));
	}

	@Override
	public List<String> getCategoryName(String categoryIds) {
		return baseMapper.getCategoryName(Func.toStrArray(categoryIds));
	}

	@Override
	public List<String> getLabelName(String labelIds) {
		return baseMapper.getLabelName(Func.toStrArray(labelIds));
	}

	@Override
	public List<String> getSpecificationName(String specificationIds) {
		return baseMapper.getSpecificationName(Func.toStrArray(specificationIds));
	}

}
